#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
using namespace std;
string Crack(string line)
{
	string oriLine;
	for (int i = 0;i<line.size();i++)
	{
		char c = line[i];
		if (c >= 'A' && c <= 'Z')
		{
		    char ch = (c  - 'A' + 21) % 26 + 'A';
			oriLine += ch;
		}else{
			oriLine += c;
		}
	}
	return oriLine;
}

int main3749()
{
	string str;
	while(getline(cin,str))
	{
		if (str == "ENDOFINPUT")
		{
			break;
		}
		string line;
		while (getline(cin,line))
		{
			
			if (line == "END")
			{
				break;
			}
			string oriLine = Crack(line);
			cout << oriLine << endl;

		}
	}
	return 0;
}